package com.neuedu.his.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.neuedu.his.common.CommonResult;
import com.neuedu.his.entity.Menu;
import com.neuedu.his.service.IMenuService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 菜单 前端控制器
 * </p>
 *
 * @author 金山
 * @since 2021-04-09
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Resource
    IMenuService menuService;

    @RequestMapping("/page")
    Page page(Page page){
//        int aa = 0/0;
        return menuService.page(page);
    }
    @RequestMapping("/getOne/{id}")
    Menu getOne(@PathVariable Integer id){
//        int aa = 0/0;
        return menuService.getById(id);
    }
    @RequestMapping("/getOne2/{id}")
    Object getOne2(@PathVariable Integer id){
//        int aa = 0/0;
        return CommonResult.success(menuService.getById(id));
    }
}
